/*
 * cross_serial_port.cpp
 *
 *  Created on: 2010-3-27
 *      Author: Administrator
 */

#include "cross_serial_port.h"

CrossPlatformSerial::CrossPlatformSerial()
    {
    }
CrossPlatformSerial::~CrossPlatformSerial()
    {
    }

bool CrossPlatformSerial::open(char* portName)
    {
    return this->serialPort.open(portName);
    }
bool CrossPlatformSerial::IsOpen(){
    return this->serialPort.IsOpen();
}
bool CrossPlatformSerial::close()
    {
    return this->serialPort.close();
    }

bool CrossPlatformSerial::setSettings(int speed, int wordSize, int stopBits,
	char parity)
    {
    return this->serialPort.setSettings(speed, wordSize, stopBits, parity);
    }

bool CrossPlatformSerial::setTimeouts(int readTimeout, int writeTimeout,
	int ReadTotalTimeoutMultiplier, int WriteTotalTimeoutMultiplier)
    {
    return this->serialPort.setTimeouts(readTimeout, writeTimeout,
	    ReadTotalTimeoutMultiplier, WriteTotalTimeoutMultiplier);
    }

int CrossPlatformSerial::readBuf(char * buf, int bufSize)
    {
    return this->serialPort.readBuf(buf, bufSize);
    }

int CrossPlatformSerial::writeBuf(char * buf, int bufSize)
    {
    return this->serialPort.writeBuf(buf, bufSize);
    }
bool CrossPlatformSerial::clearbuf()
    {
    return this->serialPort.clearbuf();
    }
